\(\int (a+b \sec ^2(e+f x)) \, dx\) [161]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 15 \[ \int \left (a+b \sec ^2(e+f x)\right ) \, dx=a x+\frac {b \tan (e+f x)}{f} \]

[Out]

a*x+b*tan(f*x+e)/f

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3852, 8} \[ \int \left (a+b \sec ^2(e+f x)\right ) \, dx=a x+\frac {b \tan (e+f x)}{f} \]

[In]

Int[a + b*Sec[e + f*x]^2,x]

[Out]

a*x + (b*Tan[e + f*x])/f

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps \begin{align*} \text {integral}& = a x+b \int \sec ^2(e+f x) \, dx \\ & = a x-\frac {b \text {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{f} \\ & = a x+\frac {b \tan (e+f x)}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \left (a+b \sec ^2(e+f x)\right ) \, dx=a x+\frac {b \tan (e+f x)}{f} \]

[In]

Integrate[a + b*Sec[e + f*x]^2,x]

[Out]

a*x + (b*Tan[e + f*x])/f

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.07

method result size
default \(a x +\frac {b \tan \left (f x +e \right )}{f}\) \(16\)
parts \(a x +\frac {b \tan \left (f x +e \right )}{f}\) \(16\)
derivativedivides \(\frac {\left (f x +e \right ) a +b \tan \left (f x +e \right )}{f}\) \(21\)
risch \(a x +\frac {2 i b}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(25\)
parallelrisch \(-\frac {2 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )}+a x\) \(35\)
norman \(\frac {a x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-a x -\frac {2 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1}\) \(51\)

[In]

int(a+b*sec(f*x+e)^2,x,method=_RETURNVERBOSE)

[Out]

a*x+b*tan(f*x+e)/f

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (15) = 30\).

Time = 0.25 (sec) , antiderivative size = 31, normalized size of antiderivative = 2.07 \[ \int \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {a f x \cos \left (f x + e\right ) + b \sin \left (f x + e\right )}{f \cos \left (f x + e\right )} \]

[In]

integrate(a+b*sec(f*x+e)^2,x, algorithm="fricas")

[Out]

(a*f*x*cos(f*x + e) + b*sin(f*x + e))/(f*cos(f*x + e))

Sympy [F]

\[ \int \left (a+b \sec ^2(e+f x)\right ) \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )\, dx \]

[In]

integrate(a+b*sec(f*x+e)**2,x)

[Out]

Integral(a + b*sec(e + f*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \left (a+b \sec ^2(e+f x)\right ) \, dx=a x + \frac {b \tan \left (f x + e\right )}{f} \]

[In]

integrate(a+b*sec(f*x+e)^2,x, algorithm="maxima")

[Out]

a*x + b*tan(f*x + e)/f

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \left (a+b \sec ^2(e+f x)\right ) \, dx=a x + \frac {b \tan \left (f x + e\right )}{f} \]

[In]

integrate(a+b*sec(f*x+e)^2,x, algorithm="giac")

[Out]

a*x + b*tan(f*x + e)/f

Mupad [B] (verification not implemented)

Time = 18.42 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.13 \[ \int \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {b\,\mathrm {tan}\left (e+f\,x\right )+a\,f\,x}{f} \]

[In]

int(a + b/cos(e + f*x)^2,x)

[Out]

(b*tan(e + f*x) + a*f*x)/f